//
//  SearchBar.m
//  微博
//
//  Created by 杨佩璋 on 15/6/25.
//  Copyright (c) 2015年 杨佩璋. All rights reserved.
//

#import "SearchBar.h"

@implementation SearchBar

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setBackground:[UIImage imageNamed:@"searchbar_textfield_background"]];
        self.placeholder = @"请输入搜索内容";
        self.font = [UIFont systemFontOfSize:13];
        
        UIImageView *searchIcon = [[UIImageView alloc] init];
        searchIcon.width = 30;
        searchIcon.height = 30;
        searchIcon.contentMode = UIViewContentModeCenter ;
        searchIcon.image = [UIImage imageNamed:@"searchbar_textfield_search_icon"];
        
        self.leftView = searchIcon;
        self.leftViewMode = UITextFieldViewModeAlways ;
        [searchIcon release];

    }
    return self;
}

+ (instancetype)searchBar
{
    return [[[SearchBar alloc] init] autorelease];
}

@end
